<?php

use Hyperf\Database\Schema\Schema;
use Hyperf\Database\Schema\Blueprint;
use Hyperf\Database\Migrations\Migration;

class CreateAdminMenu extends Migration
{
    /**
     * Run the migrations.
     */
    public function up(): void
    {
        Schema::create('admin_menu', function (Blueprint $table) {
            $table->integerIncrements('id');
            $table->unsignedInteger('pid')->default(0);
            $table->unsignedTinyInteger('seq')->default(99)->comment(' 排序');
            $table->string('name', 24);
            $table->unsignedTinyInteger('type')->default(1)->comment('1：菜单，2：按钮');
            $table->string('path', 64)->default('')->comment('前端路由路径 或者 url');
            $table->string('api', 64)->default('')->comment('后端api接口地址');
            $table->string('icon', 16)->default('')->comment('只支持 mdi icon');
            $table->unsignedTinyInteger('status')->default(0)->comment('1:启用，0：未启用');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::dropIfExists('admin_menu');
    }
}
